const Card  = require('./Card');
const CardList = Card.CardList;

class Table {
	constructor() {
		this.card_list = new CardList();
	}
	addCard(card) {
		console.log('桌面 增加 一张牌');
		this.card_list.push(card);
	}
	removeCard(card) {
		var _index = this.card_list.lastIndexOf(card);
		if (_index !== -1) {
			console.log('桌面 减少 一张牌');
			this.card_list.splice(_index, 1);
		}
	}
	lastCard() {
		return this.card_list[this.card_list.length - 1]
	}
}
module.exports = Table;